﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
namespace Lion.WeiXin.Core.Models
{
    /// <summary>
    /// web.config 配置项类
    /// </summary>
   public class Config
    {
       /// <summary>
        /// 图片上传路径 默认 /Content/UpImages
       /// </summary>
       public static string UpImagePath {
           get
           {
               if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["UpImagePath"]))
               {
                   return "/Content/UpImages";
               }
               else
               {
                   return ConfigurationManager.AppSettings["UpImagePath"];
               }
          
           }
       }

       /// <summary>
       /// 微信AppID
       /// </summary>
       public static string AppId {
           get {
               return ConfigurationManager.AppSettings["AppId"];
           }
       }
       /// <summary>
       /// 微信应用密钥
       /// </summary>
       public static string AppSecret
       {
           get
           {
               return ConfigurationManager.AppSettings["AppSecret"];
           }
       }

       /// <summary>
       /// 微信访问token
       /// </summary>
       public static string Token
       {
           get
           {
               return ConfigurationManager.AppSettings["Token"];
           }
       }

        #region 短信接口参数
       /// <summary>
       /// 是否开启短信功能
       /// </summary>
       public static bool IsOpenSMS
       {
           get
           {
               if (ConfigurationManager.AppSettings["IsOpenSMS"] == "ON")
               {
                   return true;
               }
               else
               {
                   return false;
               }
           }
       }
       /// <summary>
       /// 账号
       /// </summary>
       public static string SmsUserID
       {
           get
           {
               return ConfigurationManager.AppSettings["SmsUserID"];
           }
       }
       /// <summary>
       /// 密码
       /// </summary>
       public static string SmsPwd
       {
           get
           {
               return ConfigurationManager.AppSettings["SmsPwd"];
           }
       }
       /// <summary>
       /// 签名
       /// </summary>
       public static string SmsSign
       {
           get
           {
               return ConfigurationManager.AppSettings["SmsSign"];
           }
       }

        #endregion
    }
}
